import 'package:flutter/material.dart';
import 'package:flutter_app/components/no-record.dart';
import 'package:flutter_app/components/layout.dart';
class MyFundInvest extends StatefulWidget {
  @override
  _MyFundInvestState createState() => _MyFundInvestState();
}

class _MyFundInvestState extends State<MyFundInvest> with SingleTickerProviderStateMixin {
  TabController _tabController;
  List tabs = ["全部", "待确认", "持有中"];

  @override
  void initState() {
    super.initState();
    // 创建Controller
    _tabController = TabController(length: tabs.length, vsync: this);
  }
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        brightness: Brightness.dark,
        backgroundColor: Color(0xFF06153E),
        elevation: 0,
        iconTheme: IconThemeData(
          color: Color(0xFFECCFC7),
        ),
        title: SizedBox(
          width: 140,
          child: Row(
            children: [
              Image.asset(
                'assets/images/ic_logo_fortune.png',
                width: 35,
              ),
              Text(
                '我的套利基金',
                style: TextStyle(
                  color: Color(0xFFECCFC7),
                  fontSize: 16,
                ),
              ),
            ],
          ),
        ),
      ),
      body: Column(
        children: [
          Container(
            width: MediaQuery.of(context).size.width,
            padding: EdgeInsets.symmetric(vertical: 20.0),
            decoration: BoxDecoration(color: Color(0xFF06153E)),
            child: Column(
              children: [
                Text(
                  '\$0.00',
                  style: TextStyle(color: Color(0xFFF9D4AA), fontSize: 27),
                ),
                Text(
                  '持有资产估值',
                  style: TextStyle(color: Color(0xFF93A1C6),fontSize: 13),
                ),
                SizedBox(
                  height: 15,
                ),
                Container(
                    padding:
                        EdgeInsets.symmetric(horizontal: 15.0, vertical: 5.0),
                    decoration: BoxDecoration(
                      color: Color(0xFF1A2C78),
                      borderRadius: BorderRadius.all(Radius.circular(20)),
                    ),
                    child: Text(
                      '预估收益+\$0.00',
                      style: TextStyle(color: Color(0xFFFFEFF5)),
                    )),
              ],
            ),
          ),
          Topradius(
            bgColor:Color(0xFF06153E),
            child: TabBar(
              //生成Tab菜单
                controller: _tabController,
                labelColor: Colors.blueAccent,
                unselectedLabelColor: Colors.grey,
                indicatorColor: Colors.blueAccent,
                indicatorSize: TabBarIndicatorSize.label,
                indicatorWeight: 1.0,
                tabs: tabs.map((e) => Tab(text: e)).toList()),
          ),
          Expanded(child: NoRecord())
        ],
      ),
    );
  }
}
